Personal tools

Lua/Shared/SharedObject

From JC2-MP Documentation

< Lua‎ | Shared
Jump to: navigation, search

Description

SharedObject is an object storage, useful for sharing data with other modules.

If created on server – only accessible to server modules. Likewise with client.

Can be used to keep data between module reloads, as it is not automatically removed on module unload.


If you need to keep data synced with all players, see NetworkObject.

Static functions

Returns Prototype
SharedObject Create(string, table)
SharedObject Create(string)
SharedObject GetByName(string)

Functions

Returns Prototype
number GetId()
string GetName()
object GetValue(string, object)
object GetValue(string)
table GetValues()
Remove()
SetValue(string, object)